#ifndef OCEXCEPTION_H_INCLUDED
#define OCEXCEPTION_H_INCLUDED

#include <stdio.h>
#include <stdlib.h>

#define oc_null_pointer_exception_check( expr )   \
        ( void )( expr || oc_null_pointer_exception_proc() )

static inline void oc_null_pointer_exception_proc()
{
    fprintf( stderr, "The pointer is null!\n" );
    exit( EXIT_FAILURE );
}

#define oc_pthread_exception_check( expr )   \
        ( void )( ( expr ) == 0 || oc_mem_alloc_exception_proc() )

static inline void oc_pthread_exception_proc()
{
    fprintf( stderr, "The pointer is null!\n" );
    exit( EXIT_FAILURE );
}

#endif // OCEXCEPTION_H_INCLUDED
